<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link type="text/css" rel="stylesheet" href="css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->    
    <script type="text/javascript" src="js/jquery-1.11.1.min_044d0927.js"></script>
	<script type="text/javascript" src="js/jquery.bxslider_e88acd1b.js"></script>
    
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="js/menu.js"></script>    
        
	<script type="text/javascript" src="js/select.js"></script>
    
	<script type="text/javascript" src="js/lrscroll.js"></script>
    
    <script type="text/javascript" src="js/MagicZoom.js"></script>
    <script type="text/javascript" src="js/ShopShow.js"></script>
    
    <script type="text/javascript" src="js/iban.js"></script>
    <script type="text/javascript" src="js/fban.js"></script>
    <script type="text/javascript" src="js/f_ban.js"></script>
    <script type="text/javascript" src="js/mban.js"></script>
    <script type="text/javascript" src="js/bban.js"></script>
    <script type="text/javascript" src="js/hban.js"></script>
    <script type="text/javascript" src="js/tban.js"></script>
    
	<script type="text/javascript" src="js/lrscroll_1.js"></script>
	<script type="text/javascript" src="js/layer/layer.js"></script>
    
    <script type="text/javascript">
    	function check() {
			var loginName=$(".l_user").val();
			var pwd1=$(".l_pwd").val();
			var pwd2=$("#pwd2").val();
			var userName=$(".l_num").val();
			var email = $("input[name='email']").val();
			var mobile = $("input[name='mobile']").val();
			var identityCode = $("input[name='code']").val();
			if (loginName=="") {
				layer.msg('登录用户名不能为空!', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
				return false;
			}
			if (pwd1=="" || pwd2=="") {
				layer.msg('密码不能为空!', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
				return false;
			}
			if (pwd1 != pwd2) {
				layer.msg('两次密码输入不一致', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
				return false;
			}
			if (userName=="") {
				layer.msg('真实姓名不能为空!', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
				return false;
			}
			 //验证邮箱格式
		    if(email!=null && email!="" && !checkMail(email)){
		    	
		    	layer.msg('邮箱格式不正确', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
		    	return false;
		    }
		    //验证手机格式
		    if(mobile!=null && mobile!="" && !checkMobile(mobile)){
		    	layer.msg('手机格式不正确', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
		    	return false;
		    }
		     //验证身份证格式
		    if(identityCode!=null && identityCode!="" && !checkIdentityCode(identityCode)){
		    	layer.msg('身份证号格式不正确', {
		    		  time: 20000, //20s后自动关闭
		    		  btn: ['确定']
		    		});
		    	return false;	
		    }
			
			return true;
		}
    	$(function(){
    		$(".l_user").blur(function(){
    			var name=this.value;
    			$.get("existName","loginName="+name,function(data){
    				if (data>0) {
					layer.tips('用户名已存在', '.l_user');
					} else {
						if (name=="") {
							layer.tips('该用户名不能为空!', '.l_user');
						}else{
							layer.tips('该用户名可以使用!', '.l_user');
						}
					
					}
    			});
    		})
    	});
    	function checkMail(mail) {
  		  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  		  if (filter.test(mail)) 
  			  return true;
  		  return false;
  		}

  		function checkMobile(phone) {
  		  var filter  = /^\d{5,11}$/;
  		  if (filter.test(phone)) 
  			  return true;
  		  return false;
  		}

  		function checkIdentityCode(identityCode) {
  		  var filter  = /^\w{18}$/;
  		  if (filter.test(identityCode)) 
  			  return true;
  		  return false;
  		}
    </script>
<title>用户注册</title>
</head>
<body>  
<!--Begin Header Begin-->
<div class="soubg">
	<div class="sou">
        <span class="fr">
        	<span class="fl">你好，请<a href="Login.html">登录</a>&nbsp; <a href="Regist.html" style="color:#ff4e00;">免费注册</a>&nbsp; </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="images/s_tel.png" align="absmiddle" /></a></span>
        </span>
    </div>
</div>
<!--End Header End--> 
<!--Begin Login Begin-->
<div class="log_bg">	
    <div class="top">
        <div class="logo"><a href="Index.jsp"><img src="images/logo.png" /></a></div>
    </div>
	<div class="regist">
    	<div class="log_img"><img src="images/l_img.png" width="611" height="425" /></div>
		<div class="reg_c">
        	<form action="Regist" method="post" onsubmit="return check()">
            <table border="0" style="width:420px; font-size:14px; margin-top:20px;" cellspacing="0" cellpadding="0">
              <tr height="50" valign="top">
              	<td width="95">&nbsp;</td>
                <td>
                	<span class="fl" style="font-size:24px;">注册</span>
                    <span class="fr">已有商城账号，<a href="Login.html" style="color:#ff4e00;">我要登录</a></span>
                </td>
              </tr>
              <tr height="50">
                <td align="right"><font color="#ff4e00">*</font>&nbsp;登录用户名 &nbsp;</td>
                <td><input type="text" value="" class="l_user" name="loginName"  /><span id="span"></span></td>
              </tr>
              <tr height="50">
                <td align="right"><font color="#ff4e00">*</font>&nbsp;密码 &nbsp;</td>
                <td><input type="password" value="" class="l_pwd" name="pwd1" /></td>
              </tr>
              <tr height="50">
                <td align="right"><font color="#ff4e00">*</font>&nbsp;确认密码 &nbsp;</td>
                <td><input type="password" value="" class="l_pwd" name="pwd2" id="pwd2"/></td>
              </tr>
              <tr height="50">
                <td align="right"><font color="#ff4e00">*</font>&nbsp;真实姓名 &nbsp;</td>
                <td><input type="text" value="" class="l_num" name="userName" /></td>
              </tr>
              <tr height="50">
                <td align="right"><font color="#ff4e00">*</font>&nbsp;性别 &nbsp;</td>
                <td><input type="radio" value="1" class="l_sex" name="sex" checked="checked" />男&nbsp;&nbsp;<input type="radio" value="0" class="l_sex" name="sex" />女 </td>
              </tr>
              <tr height="50">
                <td align="right">身份证号&nbsp;</td>
                <td><input type="text" value="" class="l_mem" name="code" /></td>
              </tr>
              <tr height="50">
                <td align="right">邮箱&nbsp;</td>
                <td><input type="text" value="" class="l_email" name="email" /></td>
              </tr>
              <tr height="50">
                <td align="right"> <font color="#ff4e00"></font>&nbsp;手机 &nbsp;</td>
                <td>
                    <input type="text" value="" class="l_ipt" name="mobile" />
                </td>
              </tr>
              <tr>
              	<td>&nbsp;</td>
                <td style="font-size:12px; padding-top:20px;">
                	<span style="font-family:'宋体';" class="fl">
                    	<label class="r_rad"><input type="checkbox"  /></label><label class="r_txt">我已阅读并接受《用户协议》</label>
                    </span>
                </td>
              </tr>
              <tr height="60">
              	<td>&nbsp;</td>
                <td><input type="submit" value="立即注册" class="log_btn" /></td>
              </tr>
            </table>
            </form>
        </div>
    </div>
</div>
<!--End Login End--> 
<!--Begin Footer Begin-->
<div class="btmbg">
    <div class="btm">
        备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
        <img src="images/b_1.gif" width="98" height="33" /><img src="images/b_2.gif" width="98" height="33" /><img src="images/b_3.gif" width="98" height="33" /><img src="images/b_4.gif" width="98" height="33" /><img src="images/b_5.gif" width="98" height="33" /><img src="images/b_6.gif" width="98" height="33" />
    </div>    	
</div>
<!--End Footer End -->    

</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
